package com.tanhua.manage.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tanhua.manage.mapper.UserInfoMapper;
import com.tanhua.manage.pojo.UserInfo;
import com.tanhua.manage.vo.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

@Service
public class UserManageService {
    @Autowired
    private UserInfoMapper userInfoMapper;

    public Pager queryUsers(Integer page, Integer pageSize) {
        IPage<UserInfo> ipage = new Page(page,pageSize);
        IPage<UserInfo> userInfoIPage = userInfoMapper.selectPage(ipage, null);
        Pager<UserInfo> pager = new Pager<>();
        pager.setItems(userInfoIPage.getRecords());
        return pager;
    }
}
